<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>材质管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
		<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/basic/materialquality";
		var basic_WUrl="basic/materialquality";
		var basic_Title="材质";
		var show_Width=520;
		var show_Hight=300;
		var actionNodeID=null;
		function createSearch(){
			init(1,8,'140,140,140,140,140,140','25%');

			//第一行的数据
			addCommon(0,0,"lable","名称：");
			addCommon(0,1,"txtlike","zd002Name");
			addCommon(0,2,"lable","编码：");
			addCommon(0,3,"txtlike","zd001Code");
			addCommon(0,4,"lable","助记码：");
			addCommon(0,5,"txtlike","bizMnemonic");
		}
		function searchAP(){			
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		 function getSelected(){
			 var grid = $("#table1").ligerGetGridManager(); 
				var rows = grid.getCheckedRows();
				if(rows.length==0){
					$.dialog.alert("请选择一行数据!");
					return null;
				}else{
					return rows[0];
				}
			}
		 
		 $(function(){
			//创建JQGRID表格
				$("#table1").ligerGrid({
			        columns: [
							  { display: '编码', name: 'zd001Code', width: 150 },
			                  { display: '名称', name: 'zd002Name', width: 150},
			                  { display: '颜色', name: 'zd003Color', width: 150},
			                  { display: '创建时间', name: 'bizCreatorDate', width: 100,
			                	  render: function (item){
			                		  var cdate=new Date(item.bizCreatorDate);
			                		  return formatDate(cdate,"yyyy-MM-dd");
			                	  }
			                  },
			                  { display: '创建人', name: 'bizCreatorName', width: 120}
			                  ],  usePager: true,pageSize:15,
			                      url : basic_Url+"/list.do",method:'POST',enabledSort:false,
			                      width: '100%', height: '98%',pageSizeOptions :[15,25,35], checkbox: true,rownumbers:true,           
			                      onDblClickRow : function (data, rowindex, rowobj){
			                          edit(data);
			                       }
			                  });
				$("#pageloading").hide();
		 });
			document.onkeydown=keyListener;   
			function keyListener(e){   
			    e = e ? e : event;  
			    if(e.keyCode == 13){   
			    	searchAP();
			    }   
			} 
	</script>
  </head>
<body onload="createSearch()">
 <div id="layout1">
          <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="add()">
		           <span>添加</span></a></li>
				   <li><a class="delete" onclick="del()"><span>删除</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div> 
       <div id="table1">
      </div>
      <div class="clear"></div>
</body>
</html>